package com.jhopesoft.business.sales.entity;
// default package
// Generated 2018-3-6 16:54:10 by Hibernate Tools 5.2.6.Final

import java.math.BigDecimal;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

/**
 * SlOrderdetail generated by hbm2java
 */
@SuppressWarnings("serial")
@Entity
@Table(name = "sl_orderdetail")
public class SlOrderdetail implements java.io.Serializable {

	private String id;
	private SlOrder slOrder;
	private SlProduct slProduct;
	private String name;
	private BigDecimal numbers;
	private BigDecimal unitPrice;
	private BigDecimal amount;

	public SlOrderdetail() {
	}

	public SlOrderdetail(String id, SlOrder slOrder, SlProduct slProduct) {
		this.id = id;
		this.slOrder = slOrder;
		this.slProduct = slProduct;
	}

	public SlOrderdetail(String id, SlOrder slOrder, SlProduct slProduct, String name, BigDecimal numbers,
			BigDecimal unitPrice, BigDecimal amount) {
		this.id = id;
		this.slOrder = slOrder;
		this.slProduct = slProduct;
		this.name = name;
		this.numbers = numbers;
		this.unitPrice = unitPrice;
		this.amount = amount;
	}

	@Id
  @GeneratedValue(generator = "generator")
  @GenericGenerator(name = "generator", strategy = "uuid.hex")
	@Column(name = "id_", unique = true, nullable = false, length = 40)
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "orderid_", nullable = false)
	public SlOrder getSlOrder() {
		return this.slOrder;
	}

	public void setSlOrder(SlOrder slOrder) {
		this.slOrder = slOrder;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "productid_", nullable = false)
	public SlProduct getSlProduct() {
		return this.slProduct;
	}

	public void setSlProduct(SlProduct slProduct) {
		this.slProduct = slProduct;
	}

	@Column(name = "name_", length = 50)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "numbers_", precision = 10)
	public BigDecimal getNumbers() {
		return this.numbers;
	}

	public void setNumbers(BigDecimal numbers) {
		this.numbers = numbers;
	}

	@Column(name = "unit_price_", precision = 10)
	public BigDecimal getUnitPrice() {
		return this.unitPrice;
	}

	public void setUnitPrice(BigDecimal unitPrice) {
		this.unitPrice = unitPrice;
	}

	@Column(name = "amount_", precision = 12)
	public BigDecimal getAmount() {
		return this.amount;
	}

	public void setAmount(BigDecimal amount) {
		this.amount = amount;
	}

}
